﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using tmAsk.Common;
using tmAsk.Tools;

namespace tmAsk.Manager
{
    public partial class Admin_unzip : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            function.CheckAdminLogin();


        }
        protected void button1_Click(object sender, EventArgs e)
        {

            //递归展示文件目录
            string template = Request.Params["t"];

            ZipFile zip = new ZipFile();

            string zip_url = template.Replace("/", "").Replace("template", "");//压缩文件 // 

            try
            {
                zip.UnZip(Server.MapPath("/template/" + zip_url + ".rar"));

                Response.Write(function.alert_text(3, "解压成功！", ""));
            }
            catch
            {
                Response.Write(function.alert_text(3, "解压失败，没有找到" + Server.MapPath("/template/" + zip_url + ".rar") + "压缩文件！", ""));
            }
        }
    }
}